package org.uoss.applications.framework.dao.nativeSQL;

import java.util.Collection;

import org.uoss.core.exception.UOSSException;

public interface NativeSQLDAO <T> {
	
	/**
	 * Using SQL to query entities.
	 * 
	 * @param <T>
	 * @param sql
	 * @param beginIndex
	 * @param batchSize
	 * @return
	 * @throws UOSSException
	 */
	Collection<T> searchBySQL(String sql,Class<T> entityClass,Integer beginIndex,Integer fetchSize) throws UOSSException;
	
	/**
	 * Using SQL to query total count.
	 * 
	 * @param sql
	 * @return
	 * @throws UOSSException
	 */
	int searchTotalCountBySQL(String sql) throws UOSSException;
	
	/**
	 * Using SQL to fetch next sequence id.
	 * 
	 * @param sql
	 * @return
	 * @throws UOSSException
	 */
	Integer searchSequenceValueBySQL(String schema,String sequence) throws UOSSException;
}
